using System.Text.Json.Serialization;

namespace WeatherApp.Models
{
    // 天气信息模型
    public class WeatherInfo
    {
        public string City { get; set; } = string.Empty;
        public string Date { get; set; } = string.Empty;
        public string Weather { get; set; } = string.Empty;
        public string Temperature { get; set; } = string.Empty;
        public string Humidity { get; set; } = string.Empty;
        public string WindDirection { get; set; } = string.Empty;
        public string WindPower { get; set; } = string.Empty;
        public string AirQuality { get; set; } = string.Empty;
        public string UvIndex { get; set; } = string.Empty;
        public string Visibility { get; set; } = string.Empty;
        public string Pressure { get; set; } = string.Empty;
        public string FeelsLike { get; set; } = string.Empty;
    }

    // 天气预报模型
    public class WeatherForecast
    {
        public string City { get; set; } = string.Empty;
        public List<DailyForecast> Daily { get; set; } = new();
        public List<HourlyForecast> Hourly { get; set; } = new();
    }

    // 每日预报
    public class DailyForecast
    {
        public string Date { get; set; } = string.Empty;
        public string Weather { get; set; } = string.Empty;
        public string MaxTemp { get; set; } = string.Empty;
        public string MinTemp { get; set; } = string.Empty;
        public string Precipitation { get; set; } = string.Empty;
        public string WindDirection { get; set; } = string.Empty;
        public string WindPower { get; set; } = string.Empty;
    }

    // 小时预报
    public class HourlyForecast
    {
        public string Time { get; set; } = string.Empty;
        public string Weather { get; set; } = string.Empty;
        public string Temperature { get; set; } = string.Empty;
        public string Precipitation { get; set; } = string.Empty;
    }

    // 生活指数模型
    public class LifeIndex
    {
        public string Type { get; set; } = string.Empty;
        public string Level { get; set; } = string.Empty;
        public string Description { get; set; } = string.Empty;
    }

    // 城市信息模型
    public class CityInfo
    {
        public string Name { get; set; } = string.Empty;
        public string Code { get; set; } = string.Empty;
        public string Province { get; set; } = string.Empty;
        public double Latitude { get; set; }
        public double Longitude { get; set; }
    }

    // API响应模型
    public class ApiResponse<T>
    {
        public bool Success { get; set; }
        public string Message { get; set; } = string.Empty;
        public T? Data { get; set; }
    }

    // 用户设置模型
    public class UserSettings
    {
        public int Id { get; set; }
        public string UserId { get; set; } = string.Empty;
        public string TemperatureUnit { get; set; } = "Celsius"; // Celsius, Fahrenheit
        public string Language { get; set; } = "zh-CN"; // zh-CN, en-US
        public string Theme { get; set; } = "light"; // light, dark
        public bool Notifications { get; set; } = true;
        
        // 导航属性
        public List<string> FavoriteCities { get; set; } = new();
        public List<string> SearchHistory { get; set; } = new();
    }

    // 用户设置DTO（用于API传输）
    public class UserSettingsDto
    {
        public string TemperatureUnit { get; set; } = "Celsius";
        public string Language { get; set; } = "zh-CN";
        public string Theme { get; set; } = "light";
        public bool Notifications { get; set; } = true;
        public List<string> FavoriteCities { get; set; } = new();
        public List<string> SearchHistory { get; set; } = new();
    }
} 